home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / sticpsrc.lzh / SOURCE.ARC / NETUSER.H < prev    next >
C/C++ Source or Header  |  1990-02-06  |  2KB  |  48 lines

  1. /* Global structures and constants needed by an Internet user process */
  2. extern char HOSTS[];     /* Host table */
  3.  
  4. #define    NCONN    20        /* Maximum number of open network connections */
  5.  
  6. extern int32 ip_addr;    /* Our IP address */
  7.  
  8. extern int net_error;    /* Error return code */
  9. #define    NO_ERR    0        /* No error */
  10. #define    CON_EXISTS    1    /* Connection already exists */
  11. #define    NO_CONN    2        /* Connection does not exist */
  12. #define    CON_CLOS    3    /* Connection closing */
  13. #define    NO_SPACE    4    /* No memory for TCB creation */
  14. #define    WOULDBLK    5    /* Would block */
  15. #define    NOPROTO        6    /* Protocol or mode not supported */
  16. #define    INVALID        7    /* Invalid arguments */
  17.  
  18. /* Codes for the tcp_open call */
  19. #define    TCP_PASSIVE    0
  20. #define    TCP_ACTIVE    1
  21. #define    TCP_SERVER    2    /* Passive, clone on opening */
  22.  
  23. /* Socket structure */
  24. struct socket {
  25.     int32 address;        /* IP address */
  26.     int16 port;            /* port number */
  27. };
  28.  
  29. /* Connection structure (two sockets) */
  30. struct connection {
  31.     struct socket local;
  32.     struct socket remote;
  33. };
  34. #define    NULLSOCK    (struct socket *)0
  35.  
  36. /* TCP port numbers */
  37. #define    ECHO_PORT    7    /* Echo data port */
  38. #define    DISCARD_PORT    9    /* Discard data port */
  39. #define    FTPD_PORT    20    /* FTP Data port */
  40. #define    FTP_PORT    21    /* FTP Control port */
  41. #define TELNET_PORT    23    /* Telnet port */
  42. #define SMTP_PORT    25    /* Mail port */
  43. #define FINGER_PORT    79    /* TCP port for `who' (finger) service */
  44.  
  45. int32 aton(),resolve();
  46. char *inet_ntoa(),*inet_n2h(),*psocket(),*phsocket(),*put_tos();
  47. long htol();
  48.